#!/usr/bin/python3
# generator.py by Bill Weinman [http://bw.org/]
# This is an exercise file from Python 3 Essential Training on lynda.com
# Copyright 2010 The BearHeart Group, LLC

def main():
    #print("This is the functions.py file.")
    #for i in range(25):
     #   print(i, end = ' ')
    for i in range_inclusive(2,25,2):
        print (i, end=' ')
        
def range_inclusive(*args):
    num = len(args)
    
    if(num < 1): raise TypeError("expected at least one argument, got")

    elif (num==1):
        start = 0
        stop = args[0]
        step = 1
    elif(num==2):
        (start, stop) = args
        step = 1        
    elif(num==3):
        ( start, stop, step ) = args
    else:
         raise TypeError("expected at most 3 arguments, got:{}".format(num))   
     
    i = start
    while(i<=stop):
        yield i
        i += step


if __name__ == "__main__": main()
